<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<HTML
><HEAD
><TITLE
>Usage</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
REL="HOME"
TITLE="Universal JTAG library, server and tools"
HREF="index.html"><LINK
REL="PREVIOUS"
TITLE="Compilation and installation"
HREF="_compilation_and_installation.html"><LINK
REL="NEXT"
TITLE="JTAG commands"
HREF="_jtag_commands.html"><LINK
REL="STYLESHEET"
TYPE="text/css"
HREF="UrJTAG.css"></HEAD
><BODY
CLASS="chapter"
BGCOLOR="#FFFFFF"
TEXT="#000000"
LINK="#0000FF"
VLINK="#840084"
ALINK="#0000FF"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>Universal JTAG library, server and tools</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="_compilation_and_installation.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="_jtag_commands.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><DIV
CLASS="chapter"
><H1
><A
NAME="_usage"
></A
>Chapter 3. Usage</H1
><DIV
CLASS="section"
><H1
CLASS="section"
><A
NAME="_quick_start"
>3.1. Quick start</A
></H1
><DIV
CLASS="section"
><H2
CLASS="section"
><A
NAME="_run_the_software"
>3.1.1. Run the software</A
></H2
><P
>Connect your JTAG adapter between your PC and target device and turn
on your device.</P
><P
>To run UrJTAG type "jtag" and press Enter; jtag should start and
display some initial information. Output should end with a line like this:</P
><PRE
CLASS="literallayout"
>WARNING: UrJTAG may damage your hardware!
Type "quit" to exit, "help" for help.</PRE
></DIV
><DIV
CLASS="section"
><H2
CLASS="section"
><A
NAME="_configure_the_cable"
>3.1.2. Configure the cable</A
></H2
><P
>Type "help cable" for a list of supported JTAG cables.</P
><P
>Type the "cable" command followed by the cable name and possibly further
arguments for cable configuration. Example:</P
><PRE
CLASS="literallayout"
>jtag&#62; cable EA253 parallel 0x378
Initializing ETC EA253 JTAG Cable on parallel port at 0x378</PRE
><P
>See the section about the "cable" command for details and USB support.</P
></DIV
><DIV
CLASS="section"
><H2
CLASS="section"
><A
NAME="_detect_parts_on_the_jtag_chain"
>3.1.3. Detect parts on the JTAG chain</A
></H2
><P
>Type "detect" at the jtag command prompt:</P
><PRE
CLASS="literallayout"
>jtag&#62; detect</PRE
><P
>Your output should look like this:</P
><PRE
CLASS="literallayout"
>IR length: 5
Chain length: 1
Device Id: 01011001001001100100000000010011
  Manufacturer: Intel
  Part:         PXA250
  Stepping:     C0
  Filename:     /usr/local/share/urjtag/intel/pxa250/pxa250c0</PRE
><P
>If you get empty output or an error message your JTAG adapter is not connected
properly, or your target board doesn't work, or it is turned off.</P
><P
>The "detect" command is required before all other commands.</P
></DIV
><DIV
CLASS="section"
><H2
CLASS="section"
><A
NAME="_print_current_jtag_chain_status"
>3.1.4. Print current JTAG chain status</A
></H2
><PRE
CLASS="literallayout"
>jtag&#62; print chain
 No. Manufacturer Part   Stepping Instruction Register
---------------------------------------------------------
   0 Intel        PXA250 C0       BYPASS      BR</PRE
></DIV
><DIV
CLASS="section"
><H2
CLASS="section"
><A
NAME="_sample_device_pin_status"
>3.1.5. Sample device pin status</A
></H2
><PRE
CLASS="literallayout"
>jtag&#62; instruction SAMPLE/PRELOAD
jtag&#62; shift ir
jtag&#62; shift dr
jtag&#62; dr
1000110010000010000110010111111111111111111001101110...
jtag&#62; print chain
 No. Manufacturer Part   Stepping Instruction    Register
------------------------------------------------------------
   0 Intel        PXA250 C0       SAMPLE/PRELOAD BSR
jtag&#62; get signal BOOT_SEL[0]
BOOT_SEL[0] = 0
jtag&#62;</PRE
><PRE
CLASS="literallayout"
>Note: BSR is "Boundary Scan Register"</PRE
></DIV
><DIV
CLASS="section"
><H2
CLASS="section"
><A
NAME="_burn_flash_connected_to_the_part"
>3.1.6. Burn flash connected to the part</A
></H2
><PRE
CLASS="literallayout"
>jtag&#62; flashmem 0 brux.b
0x00000000
Note: Supported configuration is 2 x 16 bit only
BOOT_SEL: Asynchronous 32-bit ROM</PRE
><PRE
CLASS="literallayout"
>2 x 16 bit CFI devices detected (QRY ok)!</PRE
><PRE
CLASS="literallayout"
>program:
block 0 unlocked
erasing block 0: 0
addr: 0x00002854
verify:
addr: 0x00002854
Done.
jtag&#62;</PRE
><P
>or:</P
><PRE
CLASS="literallayout"
>jtag&#62; flashmem msbin xboot.bin
Note: Supported configuration is 2 x 16 bit only
BOOT_SEL: Asynchronous 32-bit ROM</PRE
><PRE
CLASS="literallayout"
>2 x 16 bit CFI devices detected (QRY ok)!</PRE
><PRE
CLASS="literallayout"
>block 0 unlocked
erasing block 0: 0
program:
record: start = 0x00000000, len = 0x00000004, checksum = 0x000001EB
record: start = 0x00000040, len = 0x00000008, checksum = 0x000001B0
record: start = 0x00001000, len = 0x00002B30, checksum = 0x00122CAB
record: start = 0x00004000, len = 0x00000160, checksum = 0x0000684B
record: start = 0x00005000, len = 0x00000054, checksum = 0x000008EE
record: start = 0x00005054, len = 0x00000030, checksum = 0x00000DA9
record: start = 0x00000000, len = 0x00001000, checksum = 0x00000000</PRE
><PRE
CLASS="literallayout"
>verify:
record: start = 0x00000000, len = 0x00000004, checksum = 0x000001EB
record: start = 0x00000040, len = 0x00000008, checksum = 0x000001B0
record: start = 0x00001000, len = 0x00002B30, checksum = 0x00122CAB
record: start = 0x00004000, len = 0x00000160, checksum = 0x0000684B
record: start = 0x00005000, len = 0x00000054, checksum = 0x000008EE
record: start = 0x00005054, len = 0x00000030, checksum = 0x00000DA9
record: start = 0x00000000, len = 0x00001000, checksum = 0x00000000</PRE
><PRE
CLASS="literallayout"
>Done.
jtag&#62;</PRE
></DIV
><DIV
CLASS="section"
><H2
CLASS="section"
><A
NAME="_non_standard_flash_commands"
>3.1.7. Non-standard flash commands</A
></H2
><P
>Erasing and programming flash devices is covered by standard procedures
in UrJTAG. Apart from these, many flash chips implement a lot more
functionality via dedicated commands that vary from between manufacturers
and device families. UrJTAG can't cover them all natively.</P
><P
>It's however possible to send any command stream to the flash by using
the poke and peek commands. You just need to clarify two things:</P
><P
></P
><OL
TYPE="1"
><LI
><P
>&#13;base address of the flash (BA)
    it's the same that's used for detectflash
</P
></LI
><LI
><P
>&#13;data width, x8 or x16
    defined by the width of the bus where the flash is attached
</P
></LI
></OL
><P
>Next look up the address/data pairs for the command in question. The data
sheet for your particular flash should document all commands in a table e.g.
If your flash is attached in x16 mode, the address must be shifted by one
position. Addresses in x8 mode are not affected.</P
><P
>The "Read Manufacturer ID" command in x16 mode would look like</P
><PRE
CLASS="literallayout"
>poke BA+(0x555*2) 0xaa
poke BA+(0x2aa*2) 0x55
poke BA+(0x555*2) 0x90
peek BA+(0x000*2)</PRE
><P
>Note that the calculations must be done beforehand. UrJTAG can't evaluate
expressions on the command line.</P
></DIV
></DIV
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="_compilation_and_installation.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="_jtag_commands.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>Compilation and installation</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
>&nbsp;</TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>JTAG commands</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>